package editor.modelo;

import java.awt.geom.Point2D;

public class Portal {

	public static  enum Clase { 
		inter_floor, intra_floor, intra_building,
	}

	public static  enum Tipo { 
		door, double_door, ustair, dstair, elevator, implicit
	}

	protected Tipo tipo;
	protected Clase clase;
	protected Space source;
	protected Space target;
	protected Point2D ptoSource;
	protected Point2D ptoTarget;
	private boolean bidirectional;
	
	protected Integer differential = new Integer(0);
	
	public Integer getDifferential() {
		return differential;
	}
	public void setDifferential(Integer height) {
		this.differential = height;
	}

	public Portal() {
		super();
	}

	public boolean isBidirectional() {
		return bidirectional;
	}

	public void setBidirectional(boolean bidirectional) {
		this.bidirectional = bidirectional;
	}

	public Tipo getTipo() {
		return tipo;
	}

	public void setTipo(Tipo tipo) {
		this.tipo = tipo;
	}

	public Clase getClase() {
		return clase;
	}

	public void setClase(Clase clase) {
		this.clase = clase;
	}

	public Space getSource() {
		return source;
	}

	public void setSource(Space source) {
		this.source = source;
	}

	public Space getTarget() {
		return target;
	}

	public void setTarget(Space destintation) {
		this.target = destintation;
	}

	public Point2D getPtoTarget() {
		return ptoTarget;
	}

	public void setPtoTarget(Point2D ptoDestination) {
		this.ptoTarget = ptoDestination;
	}

	public Point2D getPtoSource() {
		return ptoSource;
	}

	public void setPtoSource(Point2D ptoSource) {
		this.ptoSource = ptoSource;
	}
	
	public Portal getInvertedPortal(){
		Portal p = new Portal();
		p.clase = this.clase;
		p.tipo = this.tipo;
		p.ptoSource = this.ptoTarget;
		p.ptoTarget = this.ptoSource;
		p.source = this.target;
		p.target = this.source;
		p.bidirectional = this.bidirectional;
		return p;
	}

}